package 
{
	import com.oosterwijk.irc.User;
	
	import qnx.ui.core.Container;
	import qnx.ui.core.ContainerFlow;
	import qnx.ui.core.SizeUnit;
	import qnx.ui.listClasses.AlternatingCellRenderer;
	import qnx.ui.text.Label;
	
	public class UserListRenderer extends AlternatingCellRenderer
	{
		private var _prefix:Label = new Label();
		
		public function UserListRenderer()
		{
			//this.label.visible = false;
		}
		override protected function init():void
		{
			super.init();
			
		}
		override protected function drawLabel():void
		{
			this.label.x = 25;
			_prefix.x = 5;
			this.addChild(_prefix);
		}
		override public function set data(data:Object):void
		{
			super.data= data;
			if( data ){
				var user:User = data as User;
				this.label.text = user.getNick();
				this._prefix.text = user.getPrefix();
			}
		}
	}
}